namespace RBAC.Write.Api.Application.Dto
{
    using System;
    using System.Collections.Generic;

    /// <summary>
    /// 更新生产工单命令 DTO（OrderCode 作为定位键，处理时不可修改）。
    /// </summary>
    public class UpdateWorkOrderCommandDto
    {
        public string OrderCode { get; set; } = string.Empty; // 作为主定位键

        // 可更新的基础信息（实现中需判断状态是否允许）
        public string? OrderType { get; set; }
        public DateTime? OrderDate { get; set; }
        public string? CustomerName { get; set; }
        public long? CustomerId { get; set; }
        public long? ProductId { get; set; }
        public string? ProductCode { get; set; }
        public string? ProductName { get; set; }
        public string? Spec { get; set; }
        public string? Unit { get; set; }
        public decimal? Quantity { get; set; }
        public DateTime? DeliveryDate { get; set; }
        public string? Priority { get; set; }
        public long? SalesPersonId { get; set; }
        public string? SalesPerson { get; set; }
        public string? BusinessType { get; set; }
        public string? Remark { get; set; }

        // 全量替换式更新：调用端传入最新集合，处理时先删旧再插新
        public List<CreateWorkOrderBomItemDto> BomItems { get; set; } = new();
        public List<CreateWorkOrderProcessDto> Processes { get; set; } = new();
        public List<CreateWorkOrderAttachmentDto> Attachments { get; set; } = new();
    }
}
